<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<title>GeometryUtils - Three.js Docs</title>
	<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
	<script src="../scripts/highlight.min.js"></script>
	<link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
	<link type="text/css" rel="stylesheet" href="../styles/page.css">
</head>
<body>
	<h1 translate="no">GeometryUtils</h1>
		<section>
			<header>
			</header>
			<article>
				<h2 class="subsection-title">Import</h2>
				<p><span translate="no">GeometryUtils</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
				<pre><code class="language-js">import * as GeometryUtils from 'three/addons/utils/GeometryUtils.js';</code></pre>
				<div class="container-overview">
				</div>
				<h2 class="subsection-title">Methods</h2>
					<h3 class="name name-method" id="~gosper" translate="no">.<a href="#~gosper">gosper</a><span class="signature">( size : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.&lt;number></span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Generates a Gosper curve (lying in the XY plane).</p>
<p>Reference: <a href="https://gist.github.com/nitaku/6521802" target="_blank" rel="noopener">https://gist.github.com/nitaku/6521802</a></p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>size</strong>
									</td>
									<td class="description last">
										<p>The size of a single gosper island.</p>
										<p>Default is <code>1</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The gosper island points.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="~hilbert2D" translate="no">.<a href="#~hilbert2D">hilbert2D</a><span class="signature">( center : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, size : <span class="param-type">number</span>, iterations : <span class="param-type">number</span>, v0 : <span class="param-type">number</span>, v1 : <span class="param-type">number</span>, v2 : <span class="param-type">number</span>, v3 : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.&lt;<a href="Vector3.html">Vector3</a>></span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Generates 2D-Coordinates along a Hilbert curve.</p>
<p>Based on work by: <a href="http://www.openprocessing.org/sketch/15493" target="_blank" rel="noopener">http://www.openprocessing.org/sketch/15493</a></p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>center</strong>
									</td>
									<td class="description last">
										<p>Center of Hilbert curve.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>size</strong>
									</td>
									<td class="description last">
										<p>Total width of Hilbert curve.</p>
										<p>Default is <code>10</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>iterations</strong>
									</td>
									<td class="description last">
										<p>Number of subdivisions.</p>
										<p>Default is <code>10</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v0</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, -Z.</p>
										<p>Default is <code>0</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v1</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, +Z.</p>
										<p>Default is <code>1</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v2</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, +Z.</p>
										<p>Default is <code>2</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v3</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, -Z.</p>
										<p>Default is <code>3</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> The Hilbert curve points.</dt>
						</dl>
					</div>
					<h3 class="name name-method" id="~hilbert3D" translate="no">.<a href="#~hilbert3D">hilbert3D</a><span class="signature">( center : <span class="param-type"><a href="Vector3.html">Vector3</a></span>, size : <span class="param-type">number</span>, iterations : <span class="param-type">number</span>, v0 : <span class="param-type">number</span>, v1 : <span class="param-type">number</span>, v2 : <span class="param-type">number</span>, v3 : <span class="param-type">number</span>, v4 : <span class="param-type">number</span>, v5 : <span class="param-type">number</span>, v6 : <span class="param-type">number</span>, v7 : <span class="param-type">number</span> )</span><span class="type-signature"> : Array.&lt;<a href="Vector3.html">Vector3</a>></span> <span class="type-signature">(inner) </span></h3>
					<div class="method">
						<div class="description">
							<p>Generates 3D-Coordinates along a Hilbert curve.</p>
<p>Based on work by: <a href="https://openprocessing.org/user/5654" target="_blank" rel="noopener">https://openprocessing.org/user/5654</a></p>
						</div>
						<table class="params">
							<tbody>
								<tr>
									<td class="name">
										<strong>center</strong>
									</td>
									<td class="description last">
										<p>Center of Hilbert curve.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>size</strong>
									</td>
									<td class="description last">
										<p>Total width of Hilbert curve.</p>
										<p>Default is <code>10</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>iterations</strong>
									</td>
									<td class="description last">
										<p>Number of subdivisions.</p>
										<p>Default is <code>1</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v0</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, +Y, -Z.</p>
										<p>Default is <code>0</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v1</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, +Y, +Z.</p>
										<p>Default is <code>1</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v2</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, -Y, +Z.</p>
										<p>Default is <code>2</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v3</strong>
									</td>
									<td class="description last">
										<p>Corner index -X, -Y, -Z.</p>
										<p>Default is <code>3</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v4</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, -Y, -Z.</p>
										<p>Default is <code>4</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v5</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, -Y, +Z.</p>
										<p>Default is <code>5</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v6</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, +Y, +Z.</p>
										<p>Default is <code>6</code>.</p>
									</td>
								</tr>
								<tr>
									<td class="name">
										<strong>v7</strong>
									</td>
									<td class="description last">
										<p>Corner index +X, +Y, -Z.</p>
										<p>Default is <code>7</code>.</p>
									</td>
								</tr>
							</tbody>
						</table>
						<dl class="details">
							<dt class="tag-returns"><strong>Returns:</strong> <ul>
<li>The Hilbert curve points.</li>
</ul></dt>
						</dl>
					</div>
				<h2 class="subsection-title">Source</h2>
				<p>
					<a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/utils/GeometryUtils.js" translate="no" target="_blank" rel="noopener">examples/jsm/utils/GeometryUtils.js</a>
				</p>
			</article>
		</section>
<script src="../scripts/linenumber.js"></script>
<script src="../scripts/page.js"></script>
</body>
</html>